﻿using Coldairarrow.Entity.Base_Manage;
using Coldairarrow.Entity.DTO;
using Coldairarrow.Entity.UserDTO;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;

namespace Coldairarrow.Business.Base_Manage
{
    public interface IHomeBusiness
    {
        Task<string> SubmitLoginAsync(LoginInputDTO input);
        Task ChangePwdAsync(ChangePwdInputDTO input);

        string GetTheToken(WeChatRequestModel model);


        //Task<Base_User> WeChatLogin(LoginInputDTO3 input);

        //WeChatOpenReturn SaveData(User user);

        //string SaveData1(User2 user);

        //Task<Base_User> GetTheData();

        //Task UpdateUserAsync(Base_User data);
    }
    public class WeChatRequestModel
    {
        /// <summary>
        /// 签名
        /// </summary>
        public string signature { get; set; }

        /// <summary>
        /// 时间戳
        /// </summary>
        public string timestamp { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string nonce { get; set; }

        /// <summary>
        /// 随机字符串
        /// </summary>

        public string echostr { get; set; }
    }
    public class LoginInputDTO3
    {
        public string openid { get; set; }

        public string phone { get; set; }

        public string RealName { get; set; }

        public int Sex { get; set; }


        public string HeadImg { get; set; }

        public string CityCode { get; set; }

        public string CityName { get; set; }

        /// <summary>
        /// 基地
        /// </summary>
        //[Required]
        public string FactoryId { get; set; }
    }
    public class WeChatOpenReturn
    {
        public string openID { get; set; }
        public string session_key { get; set; }
    }
    public class LoginInputDTO
    {
        [Required]
        public string userName { get; set; }

        [Required]
        public string password { get; set; }


    }

    public class ChangePwdInputDTO
    {
        [Required]
        public string oldPwd { get; set; }

        [Required]
        public string newPwd { get; set; }
    }
}
